<?php

namespace app\admin\model;

use think\Model;


class WechatConfigModel extends Model
{

    // 表名
    protected $name = 'wechat_config';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'datetime';
    protected $dateFormat = 'Y-m-d H:i:s';

    // 追加属性
    protected $append = [
        'cun_text'
    ];





    public function getCunTextAttr($value, $data)
    {
        $value = $value ?: ($data['cun_id'] ?? '');
        $list = ConfigValueModel::getCommunityList();
        return $list[$value] ?? '';
    }




}
